package model

import (
	"time"
)

//用户模型
type User struct {
	Id       int64     `xorm:"pk"`
	Orgid    int       `xorm:"int(11)" form:"orgid" title:"所属机构"`
	Username string    `xorm:"varchar(100) notnull unique" form:"user" binding:"required" title:"用户名"`
	Password string    `xorm:"varchar(32) notnull" form:"pwd" binding:"required" title:"密码"`
	State    bool      `xorm:"char(1) notnull" form:"state" title:"状态"`
	Email    string    `xorm:"varchar(200)" form:"email" title:"邮箱"`
	Gender   string    `xorm:"varchar(2) notnull" form:"gender" binding:"required" title:"性别"`
	Phone    string    `xorm:"varchar(20) notnull" form:"phone" binding:"required" title:"手机号"`
	Created  time.Time `xorm:"created"`
	Updated  time.Time `xorm:"updated"`
	//DeletedAt time.Time `xorm:"deleted"` //软删除
}

//实现Str 接口方法
func (o User) ToString() string {
	return o.Username
}
